home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-11-03 | 47.1 KB | 1,125 lines |
- Newsgroups: comp.sources.misc
- subject: v08i109: pcmail part 01 of 08
- From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
- Reply-To: markl@oracle.com (Croaker the Physician)
-
- Posting-number: Volume 8, Issue 109
- Submitted-by: markl@oracle.com (Croaker the Physician)
- Archive-name: pcmail/part01
-
- [Administrivia: The monthly welcome/index posting will be delayed while I
- attempt to determine the fate of certain archive sites which seem not to be
- in the archiving business any more. ++bsa]
-
- [This package is an ELisp code library for GNU Emacs. Normally, these packages
- are made available only via anonymous FTP from GNU archives; however, the
- submitter has indicated many requests for this package from people who do not
- have FTP access. ++bsa]
-
- #--------------------------------CUT HERE-------------------------------------
- #! /bin/sh
- #
- # This is a shell archive. Save this into a file, edit it
- # and delete all lines above this comment. Then give this
- # file to sh by executing the command "sh file". The files
- # will be extracted into the current directory owned by
- # you with default permissions.
- #
- # The files contained herein are:
- #
- # -rw-rw-r-- 1 markl 6611 Oct 30 11:40 README
- # -rw-rw-r-- 1 markl 38628 Nov 2 07:53 mailhelpaa
- #
- echo 'x - README'
- if test -f README; then echo 'shar: not overwriting README'; else
- sed 's/^X//' << '________This_Is_The_END________' > README
- XInstallation and unpacking instructions, Pcmail version 4.0
- X
- XIf you are reading this, you should have already unpacked the
- Xdistribution shell archives. You should now have the following files:
- X
- XMail reader documentation:
- X
- X mailhelpaa documentation, part 1
- X mailhelpab documentation, part 2
- X mailhelpac documentation, part 3
- X
- XMail reader implementation:
- X
- X pcmail.el variable declarations, mail reader entry
- X point, miscellaneous functions
- X pcmailattr.el attribute-manipulating commands and their
- X support functions
- X pcmailbabyl.el commands and support functions which know about
- X Babyl format. All other routines use entry
- X points in this file and themselves know
- X nothing about Babyl format.
- X pcmaildate.el date handling
- X pcmaildrop.el scanning and loading of mail drop files.
- X These functions are generic; specific mail
- X drop processing functions are all in
- X pcmailsysdep.el
- X pcmailedit.el mail message editing commands
- X pcmailfolder.el folder management
- X pcmaillist.el folder-list management
- X pcmailmail.el composition of new messages, replies, and
- X forwarded messages.
- X pcmailmove.el movement within a folder
- X pcmailout.el output of messages to files, printers, and
- X other folders
- X pcmailsub.el message filtering and subsetting
- X pcmailsum.el message summary management
- X pcmailsysdep.el all system-dependent routines, including
- X definition of all mail drop import and
- X message conversion routines, print functions,
- X and message transmission (VMS only). In
- X theory, new systems can be ported to simply by
- X following the UNIX and VMS examples in this
- X file.
- X
- XMail reader support programs:
- X
- X vms-movemail.com required for VMS users only. Provides an
- X (admittedly crufty, although usable)
- X interface between the VAXMAIL system and the
- X mail reader. Moves new mail from a MAIL.MAI
- X newmail folder to the mail reader's primary
- X folder. The script works fine on our local
- X VMS 5.1, but I would strongly suggest testing it
- X on your system before relying on it, since it
- X does muck with your MAIL.MAI file and I don't
- X know VMS all that well (nor do I have a desire to).
- X
- X vms-doprint.com required for VMS users only. Sends messages
- X to a named printer.
- X
- X nntp_slave.c
- X nntp.c
- X nntp.h source code for a simple NNTP client which
- X is driven by a Pcmail NNTP mail drop
- X processor. The program requires a Berkeley
- X socket library in order to run.
- X
- X mh-to-pcmail-export a simple shell script, driven by the Pcmail
- X MH mail drop processor, which accumulates
- X message files from an MH folder directory
- X into a single file to be imported into a
- X Pcmail folder.
- X
- X
- X
- XInstallation Instructions:
- X
- XThese instructions are a subset of those in the supplied documentation.
- X
- XFirst, combine the documentation files mailhelpaa, mailhelpab, and
- Xmailhelpac into a single file.
- X
- XNext, copy all Emacs-Lisp files (*.el) into a directory where to a
- Xdirectory where the GNU-Emacs load commands will find the files.
- XThose files should then be byte-compiled. The Emacs-Lisp code must be
- Xeither manually loaded or autoloaded before the mail reader can be
- Xused. Autoloading of the mail reader is performed automatically only
- Xif the local GNU-Emacs's loaddefs.el file is set up to do so. If
- Xloaddefs.el has not been configured to autoload the mail reader, the
- Xautoload request can be performed in a GNU-Emacs initialization file
- X(e.g. ".emacs") using the Emacs-Lisp autoload form:
- X
- X (autoload 'pcmail "pcmail" "pcmail mail reader" t)
- X
- XThe following installation procedures are only necessary if you are
- X(1) running the mail reader on a VMS system, (2) you wish to use the
- XNNTP mail-drop capability, or (3) you wish to use the MH import
- Xcapability. If you do not need a capability, you can ignore the
- Xappropriate installation information
- X
- XInstalling VMS DCL Scripts
- X
- XIn order to use the mail reader on VMS, you must install the scripts
- X"vms-movemail.com" and "vms-movemail.com" in the GNU-Emacs "etc"
- Xdirectory.
- X
- XA note about the VMS mail drop importer: the vms-movemail.com DCL
- Xscript which Pcmail calls to perform the mail transfer when new mail
- Xarrives works perfectly well on our local VMS 5.1. I nonetheless
- Xstrongly suggest testing it on your system before relying on it, since
- X(1) it does muck with your MAIL.MAI file, (2) I don't know VMS all
- Xthat well (nor do I have a desire to), and (3) I don't want to be
- Xresponsible for people trashing their mail.
- X
- X
- XInstalling nntp_slave
- X
- XThe nntp_slave program is a simple (very simple) NNTP client that
- Xtakes a newsgroup name and places messages from that newsgroup into a
- Xfile. It uses a control file to keep track of which messages it has
- Xretrieved; if the control file doesn't exist, it retrieves the latest
- X20 messages from the specified newsgroup. This program requires the
- XBerkeley socket library.
- X
- XInstallation of the program is simple. Compile nntp.c and
- Xnntp_slave.c, then link both together into an executable called
- X"nntp_slave":
- X
- X cc -o nntp_slave nntp_slave.c nntp.c
- X
- XPlace the executable in the GNU-Emacs "etc" directory.
- X
- XInstalling mh-to-pcmail-export
- X
- XThe mh-to-pcmail-export program is a simple shell script which takes
- Xan MH folder name, goes to that directory, and accumulates all message
- Xfiles into a single file with separator text between messages. It is
- Xused by the mail reader when importing an MH folder into a Pcmail
- Xfolder.
- X
- XInstallation consists of moving the shell script into the GNU-Emacs
- X"etc" directory and changing the file's mode so that it is executable:
- X
- X chmod +x mh-to-pcmail-export
- X
- XAt this point, you should be ready to start reading your mail. Refer
- Xto the printed documentation (mailhelp) as well as the on-line
- Xdocumentation for full details on features and functionality.
- X
- XIf you have questions or comments, mail them to:
- X
- X internet: markl@oracle.com or markl%oracle.com@apple.com
- X UUCP: {hplabs,uunet,apple}!oracle!markl
- X
- XI work on the mail reader in my very limited spare time, so it may
- Xtake a while for enhancements to be incorporated. Bug fix requests
- Xwill be dealt with in a more timely fashion.
- X
- XHappy Hacking,
- Xmarkl
- X
- X----------
- XMark L. Lambert
- XArchitecture Group, Network Products Division
- XOracle Corporation
- X
- XInternet: markl%oracle.com@apple.com
- X markl@oracle.com (if your mailer groks MX records)
- XUUCP: ...{hplabs,apple,uunet}!oracle!markl
- XUSMail: Oracle Corporation, 20 Davis Dr, Belmont CA 94002
- XAT&T: (415) 358-3400
- X
- X"The parts falling off this car are of the finest British quality..."
- X
- ________This_Is_The_END________
- if test `wc -c < README` -ne 6611; then
- echo 'shar: README was damaged during transit (should have been 6611 bytes)'
- fi
- fi ; : end of overwriting check
- echo 'x - mailhelpaa'
- if test -f mailhelpaa; then echo 'shar: not overwriting mailhelpaa'; else
- sed 's/^X//' << '________This_Is_The_END________' > mailhelpaa
- X How to Use the Pcmail Mail Reader
- X
- X Version 4.0
- X
- X0. READ THIS FIRST
- X
- X GNU-EMACS PCMAIL mail reader
- X
- X Written by Mark L. Lambert
- X Architecture Group, Network Products Division
- X Oracle Corporation
- X 20 Davis Dr,
- X Belmont CA, 94002
- X
- X internet: markl@oracle.com or markl%oracle.com@apple.com
- X UUCP: {hplabs,uunet,apple}!oracle!markl
- X
- XCopyright (C) 1989 Mark L. Lambert
- X
- XThis file is not officially part of GNU Emacs, but is being donated to
- Xthe Free Software Foundation. As such, it is subject to the standard
- XGNU-Emacs General Public License, referred to below.
- X
- XGNU Emacs is distributed in the hope that it will be useful, but
- XWITHOUT ANY WARRANTY. No author or distributor accepts responsibility
- Xto anyone for the consequences of using it or for whether it serves
- Xany particular purpose or works at all, unless he says so in writing.
- XRefer to the GNU Emacs General Public License for full details.
- X
- XEveryone is granted permission to copy, modify and redistribute GNU
- XEmacs, but only under the conditions described in the GNU Emacs
- XGeneral Public License. A copy of this license is supposed to have
- Xbeen given to you along with GNU Emacs so you can know your rights and
- Xresponsibilities. It should be in a file named COPYING. Among other
- Xthings, the copyright notice and this notice must be preserved on all
- Xcopies.
- X
- X
- X1. Introduction
- X
- X
- XPcmail is an electronic mail reader originally designed for use as a
- Xclient of the Pcmail distributed mail repository developed at M.I.T.
- XThe mail reader has been separated from the rest of the distributed
- Xmail system, so it can run standalone like RMAIL, VM, or MH.
- X
- XThe mail reader manages electronic messages. It does not transmit
- Xmessages, although it provides commands to compose messages for
- Xtransmission. It also does not deliver mail. Instead, it assumes
- Xthat the operating system provides these two capabilities. First, the
- Xoperating system must be able to transmit electronic messages given a
- Xmessage body and message header. Second, the operating system must be
- Xable to receive electronic messages and store them in a well-known
- X"mail drop" that is accessible to the mail reader.
- X
- XIn addition to supporting the "standard" features provided in mailer
- Xreaders such as GNU-Emacs RMAIL, Pcmail also supports the following
- Xfeatures:
- X
- X multiple folders:
- X
- X Users can have any number of folders in the mail reader.
- X Creation, deletion, and renaming of folders is supported, as is
- X copying of messages between folders. Folders can be bound to a
- X number of different mail drops, so that opening a folder
- X automatically retrieves mail from these mail drops. Each folder
- X can have its own message summary; all folders can be manipulated
- X either directly or from the folder list buffer, which displays a
- X list of all folders, together with their message counts.
- X
- X user-defined mail drop formats:
- X
- X The mail reader defines a number of mail import formats: babyl,
- X Unix, MH, VMS, and NNTP. Data in any of these formats can be
- X incorporated into any folder with a simple load command. In
- X addition, import functions can be bound to folders so that
- X whenever the folder is opened, mail in the particular format
- X understood by the bound import function is retrieved and stored in
- X the folder.
- X
- X Of particular interest is the NNTP mail drop format and import
- X function, which when run via a load command retrieves new netnews
- X messages into a folder from a newsgroup with the same name as the
- X folder. This allows netnews to be treated identically to normal
- X electronic mail.
- X
- X Also of interest is the VMS mail drop format and import function,
- X which allows VMS users to read their mail from within GNU-Emacs
- X rather than the standard VAXMAIL mail reader.
- X
- X Users can define their own import functions for custom mail drop
- X formats, making it a fairly simple exercise to import from any
- X other mail format into the mail reader's Babyl format.
- X
- X automatic user-defined mail categorization:
- X
- X The mail reader allows definition of a "pigeonhole hook", which is
- X automatically applied to all new messages after they are stored in
- X a folder. The function can scan message text for keywords,
- X perhaps automatically deleting certain messages, marking their
- X priorities, auto-expiring them, or copying them to other folders.
- X
- X extensive message subsetting:
- X
- X The mail reader also implements folder filters, functions which,
- X when applied to a folder, filter its messages, restricting
- X viewable messages to those which pass through the filter. Filters
- X exist to select messages by attribute, address, string, date
- X range, numeric range, etc. User-defined message filters are also
- X supported. Messages can be automatically filtered upon opening a
- X folder, so that by default, for example, only today's messages are
- X displayed when a folder is opened.
- X
- X folder sorting:
- X
- X Folders can be grouped by date, priority, sender, or recipient, either
- X explicitly, or automatically on open. User-defined sort keys are
- X also supported.
- X
- X extended summary mode:
- X
- X Every Folder Mode command is also supported in Summary
- X Mode. Each folder has its own summary. When in a summary, any
- X command that changes the number or order of messages in the
- X summary's owning folder also automatically resummarizes the
- X folder. The reverse (resummarizing a folder when in that folder
- X and the number or order of messages in the folder changes) is
- X supported as well.
- X
- X
- X message auto-expiration:
- X
- X Messages can be set to auto-expire at a certain date. When a
- X folder is opened, all messages set to expire before that date are
- X applied to a user-definable expiration hook (which by default
- X deletes the expired message).
- X
- X user-definable date, folder mode-line, and summary line formats:
- X
- X Users can define their own summary format, folder mode-line, and
- X date formats using printf-like format strings.
- X
- X user-definable "interesting" criteria:
- X
- X Users can define a hook applied to messages to determine whether
- X or not they are "interesting" (by default, deleted messages are
- X not interesting). Most movement commands skip over uninteresting
- X messages.
- X
- X supercite support:
- X
- X The supercite package is supported via its mail-yank-hooks capability.
- X
- X RMAIL compatibility:
- X
- X Pcmail's command set is compatible with RMAIL's, although more
- X extensive.
- X
- X
- X
- X2. Concepts
- X
- X2.1 Mail Drops and Import Functions
- X
- XA mail drop is a temporary storage area that receives mail in a
- Xparticular format from a delivery process and holds it before it is
- Xtransferred into the mail reader's permanent storage area. Each
- Xoperating system has its own mail drop semantics. On VMS, a user's
- Xmail drop is a mail folder in MAIL.MAI named "newmail". Incoming mail
- Xis placed here by the VMS MAIL server before being transferred to the
- X"mail" folder by the VMS mail reader (or before begin extracted by
- XPcmail into a file and transferred into a folder). On some UNIX
- Xsystems, each user has a mail drop /usr/spool/mail/<user>, where the
- XSendmail mail delivery program places incoming messages. Finally, the
- Xmail reader defines several special mail drops, discussed later. Each
- Xmail drop is loaded by an import function, which understands the mail
- Xdrop format and is able to convert messages from that format to Babyl
- Xformat and place the converted messages in a folder.
- X
- X
- X2.2 Folders
- X
- XThe mail reader stores messages in folders. They are implemented as
- Xoperating system files underneath a mail directory. Folder files
- Xserve as permanent message storage facilities, and contain messages
- Xand additional control information used by the mail reader. The
- Xnumber of messages that can be stored in a folder is limited only by
- Xthe underlying operating system's file system. Messages are placed in
- Xfolders in one of two ways. Each folder has zero or more import
- Xfunctions attached to it. Mail in the mail drops handled by the
- Ximport functions is automatically transferred to the folder when the
- Xfolder is opened. Messages can also be copied from one folder to
- Xanother; they therefore categorize mail: junk mail can be copied to a
- Xfolder called JUNK, useful mail to a folder called USEFUL. Although
- Xthe mail reader can support any number of folders, it is initialized
- Xwith only one. This is the "primary folder" and has the same name as
- Xthe owner's system login name. The primary folder comes attached to a
- Xsystem-dependent mail drop and import function, so opening the primary
- Xfolder will automatically retrieve any new mail and store it in the
- Xfolder. Subsequent folders can be created in the mail reader using
- Xappropriate commands.
- X
- X
- X2.3 Messages
- X
- XMail messages consist of a header and a text body, both of arbitrary
- Xlength. The header in turn consists of header fields ("to:", "from:",
- X"received:", etc). Collections of messages are stored in folders.
- XEach message has two identifying numbers. The first identifies the
- Xmessage's permanent position in the folder and is that message's
- X"absolute number". The second identifies the message's position in
- Xthe current message subset (see following section on Filters and
- XSubsets). The first number is typically used internally; users intent
- Xon customizing their environments will use absolute message numbers
- Xwhen calling internal mail reader functions from customization hooks.
- XThe second type of identifying number is used externally by the user
- Xwhen identifying messages to various mail reader commands.
- X
- X
- X2.4 Attributes
- X
- XAttributes are text tags that can be attached to individual messages.
- XFor example, the "deleted" attribute is attached to messages that have
- Xbeen deleted but not yet permanently expunged from a folder. The
- X"answered" attribute is attached to all messages which have been
- Xreplied to. The mail reader pre-defines these as well as a number of
- Xother attributes. The mail reader also permits any number of
- Xuser-defined attributes; this allows users to categorize messages by
- Xattribute within a folder. See the pcmail-change-message-attr ("y")
- Xcommand for details.
- X
- X
- X2.5 Filters and Subsets
- X
- XFilters allow categorization and viewing of groups of messages within
- Xa folder. A filter is a predicate function which, when given a
- Xmessage number and optional extra information either passes or rejects
- Xthe message. After filtering, the mail reader allows access to only
- Xthose messages passed by the filter, until a new filter is selected.
- XThese messages comprise a "subset". There are a number of mail reader
- Xcommands that operate on message subsets. They can set a particular
- Xattribute on all messages in a subset, or copy all messages in a
- Xsubset to another folder, or send all messages in a subset to a
- Xprinter. Another mail reader command expands the current message
- Xsubset to include all messages in the folder, allowing access to all
- Xmessages, rather than simply those in the message subset.
- X
- XThe mail reader predefines a number of filters, discussed in detail
- Xlater: for example, the "date range" filter creates a subset of those
- Xmessages with posting dates between two specified dates. The
- X"attribute" filter creates a subset consisting of all messages that
- Xhave a particular attribute. The "interesting" filter creates a
- Xsubset consisting of messages considered interesting by the mail
- Xreader. The "all" filter creates a subset consisting of all messages
- Xin the folder, and is used by default to create the initial message
- Xsubset at mail reader startup.
- X
- XThe mail reader also supports user-defined filters. These filters are
- Xtypically defined in pcmail-hook with the pcmail-define-filter
- Xfunction. The user supplies a filter name, filter expression and an
- Xoptional argument input expression to pcmail-define-filter. When
- Xfiltering, the input function (if present and non-NIL) is run through
- Xeval to set up any arguments needed by the filter. Then each message
- Xin the folder is applied to the filter expression. The variable
- Xpcmail-current-tested-message is bound to the absolute number of the
- Xmessage being tested before the function is called. This allows the
- Xfunction to access the current absolute message number without
- Xrequiring that it do so. The filter expression is run through eval
- Xbecause the expression arguments must be evaluated at filter time and
- Xcan change on successive applications of the filter. For each message
- Xrun through the filter, if the filter expression evaluates non-NIL,
- Xthe message is included in the resulting subset. The following
- Xexample shows how to use pcmail-define-filter:
- X
- X (pcmail-define-filter "frob-message"
- X '(my-filter-function "foo")
- X '(setq my-default-arg (my-input-function)))
- X
- XThe function my-input-function is called before any messages are
- Xtested; it sets a global variable my-default-arg, which can be used
- Xby my-filter-function.
- X
- XRemember that when filtering, the current message's absolute number is
- Xalways bound to pcmail-current-tested-message; my-filter-function can
- Xuse this value when performing its processing.
- X
- X
- X2.6 Hooks
- X
- XA hook is an Emacs-Lisp expression which is evaluated in conjunction
- Xwith performing a task. Hooks are typically used as a means for users
- Xto customize their environment. For instance, "pcmail-hook" is an
- XEmacs-Lisp expression evaluated upon entry into the mail reader. It
- Xis used to customize a mail reader instance by setting various
- Xconfiguration variables. "pcmail-pigeonhole-hook" is an Emacs-Lisp
- Xexpression applied to every new message after it is transferred from a
- Xmail drop to a folder. It allows manipulation of a message before it
- Xis displayed (for example, the weeding out of junk mail, or automatic
- Xmarking of some messages as high priority). Other hooks are discussed
- Xin detail later.
- X
- X
- X2.7 Prefix Arguments
- X
- XMany mail reader commands behave differently if prefaced with a prefix
- Xargument. Standard GNU-Emacs prefix arguments are entered by typing
- XControl-U<number> or ESC<number> before a command. The mail reader
- Xaccepts prefix numbers without the Control-U or ESC.
- X
- XSome commands interpret a numeric prefix argument; for instance the
- Xpcmail-goto-message ("j") command, when given a numeric prefix argument N,
- Xjumps to the Nth message in the message subset. Other commands simply
- Xnote the existence of a prefix argument and behave differently.
- X
- X
- X
- X3. Installing and Customizing the Mail Reader
- X
- X3.1 Basic Installation
- X
- XThe mail reader is installed in two parts. First, the Emacs-Lisp code
- Xmust be installed. All Emacs-Lisp (".el") files must be copied to a
- Xdirectory where the GNU-Emacs load commands will find the files.
- XThose files should then be byte-compiled. The Emacs-Lisp code must be
- Xeither manually loaded or autoloaded before the mail reader can be
- Xused. Autoloading of the mail reader is performed automatically if
- Xthe local GNU-Emacs's loaddefs.el file is set up to do so. If
- Xloaddefs.el has not been configured to autoload the mail reader, the
- Xautoload request can be performed in a GNU-Emacs initialization file
- X(e.g. ".emacs") using the Emacs-Lisp autoload form:
- X
- X (autoload 'pcmail "pcmail" "pcmail mail reader" t)
- X
- XOnce the mail reader software has been loaded, the mail reader is
- Xentered by typing "ESC x Pcmail". If the GNU-Emacs initialization
- Xfile has a key binding expression that binds the Emacs-Lisp function
- XPcmail to a keystroke sequence, for example:
- X
- X (global-set-key "\C-xp" 'pcmail)
- X
- Xthen the mail reader can be entered by typing the keystroke sequence
- X"control-X P".
- X
- XThe following installation procedures are only necessary if you are
- X(1) running the mail reader on a VMS system, (2) you wish to use the
- XNNTP mail-drop capability, or (3) you wish to use the MH import
- Xcapability. If you do not need a capability, you can ignore the
- Xappropriate installation information.
- X
- X3.2 Installing VMS DCL Scripts
- X
- XIn order to use the mail reader on VMS, you must install the scripts
- X"vms-movemail.com" and "vms-movemail.com" in the GNU-Emacs "etc"
- Xdirectory.
- X
- XA note about the VMS mail drop importer: the vms-movemail.com DCL
- Xscript which Pcmail calls to perform the mail transfer when new mail
- Xarrives works perfectly well on our local VMS 5.1. I nonetheless
- Xstrongly suggest testing it on your system before relying on it, since
- X(1) it does muck with your MAIL.MAI file, (2) I don't know VMS all
- Xthat well (nor do I have a desire to), and (3) I don't want to be
- Xresponsible for people trashing their mail.
- X
- X3.3 Installing nntp_slave
- X
- XThe nntp_slave program is a simple (very simple) NNTP client that
- Xtakes a newsgroup name and places messages from that newsgroup into a
- Xfile. It uses a control file to keep track of which messages it has
- Xretrieved; if the control file doesn't exist, it retrieves the latest
- X20 messages from the specified newsgroup.
- X
- XInstallation of the program is simple. Compile nntp.c and
- Xnntp_slave.c, then link both together into an executable called
- X"nntp_slave":
- X
- X cc -o nntp_slave nntp_slave.c nntp.c
- X
- XPlace the executable in the GNU-Emacs "etc" directory.
- X
- X3.4 Installing mh-to-pcmail-export
- X
- XThe mh-to-pcmail-export program is a simple shell script which takes
- Xan MH folder name, goes to that directory, and accumulates all message
- Xfiles into a single file with separator text between messages. It is
- Xused by the mail reader when importing an MH folder into a Pcmail
- Xfolder.
- X
- XInstallation consists of moving the shell script into the GNU-Emacs
- X"etc" directory and changing the file's mode so that it is executable:
- X
- X chmod +x mh-to-pcmail-export
- X
- X
- X3.5 Customizing
- X
- XThe mail reader is extensively customizable; a list of configuration
- Xvariables and their meanings follows. No customization is required
- Xsince the mail reader provides a reasonable set of defaults for its
- Xoperations. To change the mail reader's default behaviour, make the
- Xappropriate configuration variable settings within an Emacs-Lisp
- Xexpression named "pcmail-hook". If pcmail-hook exists, the mail
- Xreader evaluates it on startup unless the startup command was executed
- Xwith a prefix argument. The hook should be defined in the GNU-Emacs
- Xinitialization file. For example:
- X
- X (setq pcmail-hook '(lambda ()
- X (setq pcmail-delete-on-print t)
- X (setq pcmail-delete-on-copy t)
- X (setq pcmail-delete-on-archive t)
- X (setq pcmail-highlight-forwarded-message t)
- X (setq pcmail-uninteresting-fields-list
- X (cons "in-reply-to"
- X pcmail-uninteresting-fields-list))))
- X
- XThe following configuration variables, together with their defaults,
- Xare currently available. Variables can be set with the Emacs-Lisp "setq"
- Xform:
- X
- X (setq foo <foo's value>)
- X
- Xpcmail-date-format
- X
- XThe format string used to format dates is user-configurable. The
- Xformat string is similar to a C printf or Emacs-Lisp "format" string,
- Xwith embedded format directives and associated arguments controlling
- Xthe format of an output string. As with printf and the Emacs-Lisp
- Xfunction "format", any format directive character can be prefaced by a
- Xfield width number. A negative number denotes left-justification, a
- Xpositive number right justification. Numeric format arguments are
- Xinserted into the output string with leading zeroes if the directive
- Xlength specifier is also prefaced with a leading zero. The following
- Xformat directives are recognized:
- X
- X %d: replace with the day of the month
- X %n: replace with the number of the month
- X %m: replace with the first three letters of the month
- X %M: replace with the full name of the month
- X %y: replace with the last two digits of the year
- X %Y: replace with the full year
- X
- XDefault value of pcmail-date-format is: "%d-%m-%y"
- X
- Xpcmail-default-filter-name
- X
- XWhen the mail reader starts up, all messages in the primary folder are
- Xfiltered through a default filter. That filter is named by
- Xpcmail-default-filter-name and defaults to "all", the pre-defined
- Xfilter that passes all messages. Thus, the mail reader's behaviour on
- Xstartup is to allow access to all messages in the folder. Note that
- Xif the default filter name is changed, access to all messages can
- Xalways be gained with the pcmail-expand-subset ("x") command.
- X
- Xpcmail-delete-on-archive
- X
- XIf this variable is non-NIL, messages that are archived to a file will
- Xhave their "deleted" attribute set after archiving. Default value is
- XNIL.
- X
- Xpcmail-delete-on-copy
- X
- XIf this variable is non-NIL, messages that are copied to another
- Xfolder will have their "deleted" attribute set in the source folder
- Xafter copying. Default value is NIL.
- X
- Xpcmail-delete-on-print
- X
- XIf this variable is non-NIL, messages that are printed will have their
- X"deleted" attribute set after printing. Default value is NIL.
- X
- Xpcmail-expiration-hook
- X
- XAn Emacs-Lisp function (similar in form to the sample hook shown
- Xabove) that takes as an argument an absolute message number and is
- Xapplied to all messages with the "timely" attribute when the current
- Xdate is later than the date in the message header's "expires:" field.
- XThe default hook takes a message with absolute number N and sets N's
- X"deleted" attribute.
- X
- Xpcmail-expunge-on-save
- X
- XIf this variable is non-NIL, a folder is always expunged before being
- Xsaved when the pcmail-save-folder command is issued. Default value is
- XT.
- X
- Xpcmail-folder-list-mode-hook
- X
- XAn Emacs-Lisp hook expression that is executed after putting a buffer
- Xinto Folder List Mode. This allows users to customize commands
- Xavailable in Folder List Mode.
- X
- Xpcmail-folder-mode-hook
- X
- XAn Emacs-Lisp hook expression that is executed after putting a buffer
- Xinto Folder Mode. This allows users to customize commands available
- Xin Folder Mode.
- X
- Xpcmail-folder-mode-line-format
- X
- XThe format string used to format a folder's mode line. Works as
- Xpcmail-date-format above. The following format directives are
- Xrecognized:
- X
- X %a: replace with the current message's attribute list, or
- X "[no attributes]", if the message has no attributes
- X %c: replace with the current message's character count
- X %e: replace with the word "Editing" if the current message is
- X being edited.
- X %E: if the current message is timely, replace with its expiration date
- X %f: replace with the current folder name
- X %l: replace with the current message's line count
- X %n: if the current subset does not comprise the entire folder, or the
- X current message's number is not the same as its absolute number,
- X replace with the message's absolute number and the total number of
- X messages in the folder in the form "[<curr>/<total>]"
- X %p: replace with the current message's priority if the priority
- X number is greater than 1.
- X %s: replace with the current message's number
- X %S: replace with the number of messages in the current subset
- X
- XDefault value of pcmail-folder-mode-line-format is:
- X
- X "Folder: %-18f (%eMessage %s/%S%n: %a) %p"
- X
- Xpcmail-highlight-forwarded-message
- X
- XIf this variable is non-NIL, the words "begin forwarded message" are
- Xplaced before a forwarded message and the words "end forwarded
- Xmessage" after it. Default value is NIL.
- X
- Xpcmail-interesting-hook
- X
- XAn Emacs-Lisp function that takes as an argument an absolute message
- Xnumber N, and determines whether or not message N is interesting.
- XUninteresting messages are skipped over by most mail reader message
- Xmovement commands. They are also filtered out when using the
- X"interesting" message filter. Any Emacs-Lisp expression can be used
- Xhere; if the expression is NIL, then all message are considered
- Xinteresting. The expression's default value defines deleted messages
- Xand messages with priority number 5 and higher as uninteresting.
- X
- Xpcmail-nntp-host-name
- X
- XThe name of your local NNTP server. Only interesting if you are using
- XThe nntp-mail-drop or nntp-file-mail-drop mail drop types, in which case it
- Xmust be defined. Default value is "newshost".
- X
- Xpcmail-pigeonhole-hook
- X
- XAn Emacs-Lisp function that takes as an argument an absolute message
- Xnumber N. The function (if defined) is applied to each new message N
- Xas it is transferred from a mail drop to a folder. When the
- Xexpression is evaluated, the message has already been appended to the
- Xfolder, thus any internal mail reader function that uses an absolute
- Xmessage number will work properly. Note that most of the interesting
- Xthings this hook can do require knowledge of mail reader primitives
- Xnot described in this manual. They are of course self-documented
- Xinside GNU-Emacs. Default value is NIL.
- X
- Xpcmail-printer-name
- X
- XThe name of the printer that the mail reader sends messages to when
- Xthe pcmail-print-message command is issued. Default value is
- Xoperating-system dependent. On VMS systems, the value is "SYS$PRINT",
- Xon UNIX systems, the value is either the environment variable
- X"PRINTER", or (if "PRINTER" is not defined) the standard printcap
- Xprinter name "lp".
- X
- Xpcmail-progress-interval
- X
- XWhen performing time-intensive tasks like message counting or
- Xfiltering, progress notification is displayed every
- Xpcmail-progress-interval mail messages, with the total number of mail
- Xmessages processed displayed upon completion of the task. Default
- Xvalue is 10.
- X
- Xpcmail-resummarize-folder-on-change
- X
- XIf non-NIL, resummarize a folder that has an existing summary every
- Xtime the folder changes. Changes are defined as a change in the
- Xnumber of messages in the folder's current subset or a change in their
- Xorder. Default value is NIL.
- X
- Xpcmail-save-on-quit
- X
- XIf this variable is non-NIL, all open folders are saved before
- Xexiting the mail reader via the pcmail-quit command. Default value is
- XT.
- X
- Xpcmail-summary-format
- X
- XThe format a message summary line takes (when summarizing a folder
- Xwith the pcmail-summarize-folder or pcmail-folder-summarize-folder
- Xcommands) is user-configurable. The variable controlling the format
- Xis pcmail-summary-format. The format string works as
- Xpcmail-date-format and pcmail-folder-mode-line-format defined above.
- XThe following directives are recognized:
- X
- X %b: replace with the contents of the message's Bcc: field
- X %c: replace with the contents of the message's Cc: field
- X %C: replace with the message's character count
- X %d: replace with the contents of the message's Date: field
- X %f: replace with the contents of the message's From: field
- X %l: replace with the message's line count
- X %m: replace with the contents of the message's Message-Id: field
- X %s: replace with the contents of the message's Subject: field
- X %t: replace with the contents of the message's To: field
- X
- XNote that once a message has been summarized, changing the format will
- Xnot affect that message's summary line appearance. Format changes
- Xonly affect messages summarized after the change. Default value of
- Xpcmail-summary-format is: "%d %25f %s".
- X
- Xpcmail-summary-mode-hook
- X
- XAn Emacs-Lisp hook expression that is executed after putting a buffer
- Xinto Summary Mode. This allows users to customize commands available
- Xin Summary Mode.
- X
- Xpcmail-uninteresting-fields-list
- X
- XAny message field on this list is by default removed from the message
- Xheader when the message is displayed. The
- Xpcmail-toggle-message-header ("t") command displays such pruned header
- Xfields anyway. Default uninteresting fields are:
- X
- X via: mail-from: origin: status:
- X received: message-id: resent-message-id: summary-line:
- X return-path:
- X
- XAdding uninteresting fields is done with an Emacs-Lisp expression like the
- Xfollowing:
- X
- X (setq pcmail-uninteresting-fields-list
- X (append '("in-reply-to" "path" "lines" "keywords"
- X "references" "summary" "xref")
- X pcmail-uninteresting-fields-list))))
- X
- X
- Xpcmail-wastebasket-folder
- X
- XThe name of the wastebasket folder. The wastebasket is a useful place
- Xto put unwanted messages that for some reason cannot or should not be
- Ximmediately expunged from the system. The wastebasket is presented
- Xprimarily for use in user-defined pigeonhole hooks and is only used by
- Xthe mail reader in conjunction with the pcmail-wastebasket-on-expunge
- Xconfiguration variable. Default value is "wastebasket".
- X
- Xpcmail-wastebasket-on-expunge
- X
- XIf this variable is non-NIL, the mail reader will copy all of a
- Xfolder's deleted messages to pcmail-wastebasket-folder upon expunge of
- Xthe folder. This can be a time-consuming operation. Default value is
- XNIL.
- X
- Xpcmail-yank-message-on-reply
- X
- XIf this variable is non-NIL, the pcmail-answer-message command will
- Xautomatically insert a copy of the replied-to message in the message
- Xreply. Default value is NIL.
- X
- Xpcmail-yank-prefix
- X
- XIf this variable is a string, any message inserted into the message
- Xcomposition buffer (i.e. by pcmail-yank-message-on-reply, or
- Xpcmail-insert-current-message) will have that string placed at the
- Xbeginning of each non-blank line. Default value is NIL.
- X
- X
- X4. Using the Mail Reader
- X
- XThe following sections describe how to enter the mail reader and
- Ximport mail from other mail systems.
- X
- X4.1
- X
- XEnter the mail reader by executing the mail reader startup function
- X"pcmail". If the function has been bound to a keystroke sequence,
- Xtyping the keystrokes will enter the mail reader. If not, typing:
- X
- X ESC x pcmail
- X
- Xwill enter the mail reader.
- X
- XAt this point several things happen. The first time the mail reader
- Xis used, it asks whether it should create a mail directory. The name
- Xof this directory is operating-system dependent, and is defined in the
- Xvariable pcmail-directory. All folders are stored as files in this
- Xdirectory; also stored in the directory are operating-system dependent
- Xtemporary files, as well as the folder list file, which contains
- Xinformation on each folder created by the mail reader.
- X
- XOnce the mail directory has been created, the mail reader will ask to
- Xcreate a primary folder with the same name as your system login name.
- XAttached to the folder are one or more mail drops corresponding to the
- Xoperating system mail server's mail drops.
- X
- XOnce the mail directory and primary folder have been created,
- X"standard" mail reader processing begins. Unless a prefix argument
- Xwas given the mail reader entry command, the Emacs-Lisp hook
- Xpcmail-hook is evaluated, performing any customizing. The primary
- Xfolder is opened and placed in Folder Mode. The hook pcmail-mode-hook
- Xis evaluated, allowing users to set up their own mode-specific key
- Xbindings. Any new mail is transferred to the folder from its attached
- Xmail drop(s). If there are any unseen messages in the folder, the
- Xfirst unseen message is displayed, otherwise the last interesting
- Xmessage in the folder is displayed. "Interesting" messages default to
- Xmessages which have not been deleted. The definition of "interesting"
- Xcan be changed by modifying the Emacs-Lisp hook expression
- Xpcmail-interesting-hook as per the information in the section
- Xdescribing configuration variables.
- X
- XAt this point all Folder Mode commands are available. Standard
- XGNU-Emacs commands are also available; bear in mind that many of the
- Xkeystrokes which execute GNU-Emacs commands may have been superseded
- Xby Folder Mode commands. Although folders are ordinary text files,
- Xthey cannot be modified while they are in Folder Mode. All GNU-Emacs
- Xbuffer-modification commands are disabled in Folder Mode.
- X
- X
- X4.2 Getting Help
- X
- XGNU-Emacs is a self-documenting editor; information on any part of the
- Xeditor (including the mail reader) is available via the GNU-Emacs help
- Xfacility. Typing "?" in any mail reader mode will display a list of
- Xcommands available in that mode, together with the keystrokes that
- Xexecute them. Executing the GNU-Emacs Help command (default
- XControl-h) followed by "k" or "f", will give detailed documentation on
- Xcommands by keystroke or function name, respectively. Executing the
- XHelp command followed by "v" gives detailed documentation on
- Xconfiguration variables.
- X
- X
- X4.3 Input Completion
- X
- XWhen the mail reader command requires input from the minibuffer, input
- Xcompletion is permitted whenever possible. If the command requires as
- Xinput a member of a set of possible values, you need input only enough
- Xcharacters to uniquely identify the value. Hitting TAB or SPC then
- Xautomatically completes the value. If the value is not unique, TAB or
- XSPC will present a pop-up window with a list of valid values. In the
- Xfollowing command documentation, any command which permits input
- Xcompletion is so noted.
- X
- X
- X4.4 Importing Existing Mail State
- X
- XFew users will begin using Pcmail from scratch, with no prior mail
- Xstate. Pcmail understands a number of mail drop formats, and defines
- Ximport functions which allow importing of messages from these mail
- Xdrops to Pcmail folders. These import functions can be permanently
- Xbound to a folder when the folder is first creates; this causes the
- Xmail drop to be scanned for new mail whenever the folder is opened.
- X
- XImporting mail is easy, provided the mail to be imported is in one of
- Xfour common formats: VMS Mail Extract files, MH folders, Babyl files,
- Xor ordinary Berkeley mail files. If the existing mail is not in any of
- Xthese formats, a custom import function must be built for the new mail
- Xdrop format. Although this is not difficult, it is not discussed in
- Xthis document since it is fairly specialized reading, and a number of
- Xexamples in the mail reader will show how to write an import function.
- X
- XFirst, create the folder which will hold the imported mail. If you
- Xwish the folder to have new mail from a mail drop automatically loaded
- Xwhenever the folder is opened, use a prefix argument with the folder
- Xcreate command. The create command will then request the name of a
- Xmail drop format, which it will bind to the folder.
- X
- XNext, use the pcmail-load-mail-drop ("l") command. At the minibuffer
- Xprompt, input the name of the mail drop format. Completion on input
- Xis permitted. Input any mail drop-specific arguments as required.
- X
- XThe mail reader will then load the mail into the current folder. Note
- Xthat some import functions are destructive; they delete the mail drop
- Xafter loading its mail into the folder. Most of the time this is
- Xdesirable behaviour, since mail drops are by definition temporary
- Xstorage areas. If a destructive import is being performed on mail
- Xwhich should not be deleted for some reason, back up the mail drop
- Xbefore importing. The pcmail-load-mail-drop command documentation
- Xdescribes in detail which import functions are destructive and which
- Xare not.
- X
- X4.5 Leaving the mail reader
- X
- XThere are two ways to exit Pcmail. First, there is the pcmail-quit
- Xcommand, bound to the "q" key in all mail reader modes. This exits
- XPcmail in an orderly fashion. First it by default saves all open
- Xfolders. The save process in turn by default expunges all deleted
- Xmessages in the saved folders. Finally, the Emacs-Lisp hook
- Xexpression pcmail-exit-hook is evaluated, and the command prompts for
- Xa new GNU-Emacs buffer to enter.
- X
- XSince the mail reader is implemented as a major editing mode applied
- Xto files with a particular format, switching to a buffer not in
- XFolder Mode effectively also exits the mail reader.
- X
- X
- X
- X5. Mail Reader Commands
- X
- XFollowing are a list of mail reader commands, grouped by mode. Pcmail
- Xhas three modes. Folder List Mode implements folder creation,
- Xdeletion, and manipulation in the Folder List buffer. Summary Mode
- Ximplements manipulation of messages while in a summary list of
- Xmessages. Finally, Folder Mode implements manipulation of folders and
- Xmessages while in a folder.
- X
- XCommands are listed alphabetically by keystroke. The standard
- XGNU-Emacs key-naming conventions are used, thus ESC x notes escape- or
- Xmeta-X, C-d denotes control-D, and ESC C-x denotes escape-control- or
- Xcontrol-meta-X. Function names are also included for reference. Some
- Xfunctions are not bound to any keystrokes. They can be executed by
- Xtyping ESC x <function-name>.
- X
- X
- X5.1 Folder Mode Commands
- X
- XFolder buffers opened by the mail reader are always placed in Folder
- XMode. A folder buffer contains all the messages in that folder,
- Xhowever not all of the messages are always immediately accessible.
- XThe collection of messages accessible at any one time is called the
- X"message subset". The message subset can be modified using various
- Xmail reader commands; it is set by default at startup to include all
- Xmessages. This can be altered by changing the variable
- Xpcmail-default-filter-name to any valid folder filter. The startup
- Xsubset will then consist of those messages passed by the new filter.
- X
- XEach message in the message subset is given a number, identifying its
- Xposition in the subset. This number, together with the total number
- Xof messages in the subset and any message attributes, is displayed in
- Xthe mode line. If the message subset does not contain all messages in
- Xthe folder, or the subset order is different from the actual order,
- Xthen the message's absolute message number and the total number of
- Xmessages in the folder are also displayed in the mode line.
- X
- XThe following list of Folder Mode commands are grouped by class:
- Xmovement, attribute setting, mail composition, message output, folder
- Xmodification, and miscellaneous.
- X
- X
- X5.1.1 Getting help
- X
- X?: describe-mode
- X
- XDisplay a list of available commands and the keystrokes they are bound
- Xto. Typing The GNU-Emacs Help key, followed by "k" or "f" will
- Xpresent documentation on functions by keystroke or function name,
- Xrespectively.
- X
- X
- X5.1.2 Movement Commands
- X
- X.: pcmail-beginning-of-message
- X
- XMove to the beginning of the current message.
- X
- XSPC: scroll-up
- X
- XShow the next page of the current message
- X
- XDEL: scroll-down
- X
- XShow the previous page of the current message
- X
- X<: pcmail-goto-message
- X
- XJump to the first message in the message subset.
- X
- X>: pcmail-last-message
- X
- XJump to the last interesting message in the message subset. For a
- Xdiscussion on what consitutes an interesting message, see the
- Xconfiguration section, variable pcmail-interesting-hook. With a
- Xprefix argument, jump to the last message in the subset whether or not
- Xit is interesting.
- X
- Xj: pcmail-goto-message
- X
- XWith a prefix argument N, jump to the Nth message in the message subset.
- XWith no prefix argument jump to the first message in the message subset.
- X
- Xn, RET: pcmail-next-message
- X
- XGo to the next interesting message in the message subset. With a
- Xprefix argument, go to the next message whether or not it is interesting.
- X
- XESC n: pcmail-next-message-of-type
- X
- XRead a folder filter type from the minibuffer. Input completion
- Xis permitted; input defaults to the last filter name given a filter
- Xcommand. Go to the next message passed by the filter. This is
- Xextremely useful in large folders, where for example a user might want
- Xto find the next message from "fred@frobozz".
- X
- Xp: pcmail-previous-message
- X
- XGo to the nearest previous interesting message in the message subset.
- XWith a prefix argument, go to the previous message whether or not it
- Xis interesting.
- X
- XESC p: pcmail-previous-message-of-type
- ________This_Is_The_END________
- if test `wc -c < mailhelpaa` -ne 38628; then
- echo 'shar: mailhelpaa was damaged during transit (should have been 38628 bytes)'
- fi
- fi ; : end of overwriting check
- exit 0
-
-